package com.csmht.tododemo.controller.visitor;

import com.csmht.tododemo.pojo.vo.ToDoVO;
import com.csmht.tododemo.result.Result;
import com.csmht.tododemo.service.VisitorService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/visitor")
@Slf4j
public class VisitorController {

    @Resource
    private VisitorService visitorService;

    @GetMapping
    public Result<ToDoVO> visitor(@RequestParam String key) {
       ToDoVO toDoVO = visitorService.getByKey(key);
        return Result.success(toDoVO);
    }


}
